package com.wwzz.service;
import com.wwzz.model.User;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    /**
     * 根据用户id获取用户对象
     * @param id
     * @return
     */
    public User findUserById(int id){
        // 伪代码 返回用户对象
        User user = new User();
        if (id == 1){
            user.setId(1);
            user.setName("张三");
            user.setAge(18);
        }else {
            user.setId(2);
            user.setName("李四");
            user.setAge(20);
        }
        return user;
    }



    public void SayHello(String name){
        System.out.println("Hello! " + name);
    }
}
